﻿using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using SharppiFlowEditor.controllers;
using SharppiFlowEditor.views;

namespace SharppiFlowEditor.models
{
    public abstract class AbstractNode : INode
    {
        protected string _title;        
        protected Color _bgColor;
        protected Font nodeFont;
        protected int _type = 0;
        protected Rectangle _boundingRect;

        public AbstractNode()
        {
            nodeFont = new Font("verdana", 10);
            _bgColor = new Color();
        }
    
        public abstract void draw(Graphics g);
        public abstract void draw(Graphics g, double zoomSize);

        public abstract Rectangle getBoundingRect();
        public abstract void setBoundingRectLocation(int x, int y);
        public Rectangle getRelativeBoundingRect(double zoomSize)
        {
            return new Rectangle((int)(_boundingRect.X * zoomSize), (int)(_boundingRect.Y * zoomSize), (int)(_boundingRect.Width * zoomSize), (int)(_boundingRect.Height * zoomSize));
        }
        
        //set and get background color & node title
        public Color BGColor 
        {
            get { return _bgColor; }
            set { _bgColor = value; } 
        }

        public string Title 
        {
            get { return _title; }
            set { _title = value; } 
        }

        public int Type 
        {
            get { return _type; }
            set { _type = value; } 
        }


    }
}
